package com.ibm.ems.servlets;

import java.io.IOException;
import java.sql.Connection;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ibm.ems.dao.LocationDAO;
import com.ibm.ems.dto.LocationBean;
import com.ibm.ems.util.ConnectionUtil;

/**
 * Servlet implementation class TopicModifyServlet
 */
public class LocationModifyServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		LocationBean p=new LocationBean();
		Connection conn = ConnectionUtil.getConnection();
		LocationDAO td1=new LocationDAO(conn);
		RequestDispatcher rd;
		
		if(request.getParameter("loc_code")!=null)
		{
		p.setLoc_code(request.getParameter("loc_code"));
		 rd=request.getRequestDispatcher("/LocationModify.jsp");
		td1.modify(p);
			
		
		request.setAttribute("b",p );
			rd.forward(request,response);
		}
		else
		{}
			
			
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
